import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class LocalStorageService {

  constructor() { }

  getStorageData(key:string){
    //return new Promise((data)=>{
     return JSON.parse(localStorage.getItem(key));
    //})
  }

  setStorageData(key:string,value:any){
    localStorage.setItem(key,JSON.stringify(value));
  }
  // setStorageDataOne(value:any){
  //   localStorage.setItem(JSON.stringify(value));
  // }


  removeStorageData(key:string) {
    localStorage.removeItem(key)
  }

  removeAllStorageData() {
    localStorage.clear();
  }
}
